import { ref,reactive, computed } from 'vue'
import { defineStore } from 'pinia'

export const useSystemStore = defineStore('system', () => {
  
  const collapse = ref(false)   // 导航栏收缩状态

  const schoolInfo = ref({})      // 登录的学校信息
   

  //初始化学校信息
  const initSchoolInfo = (schoolInfoParam:object)=>{
    schoolInfo.value = schoolInfoParam
  }

  //改变收缩状态
  const toggleCollapse = ()=>{
    collapse.value = !collapse.value;
  }

  //退出登录
  const logout = ()=>{
    schoolInfo.value = {};
  }
  
  return { collapse,schoolInfo, initSchoolInfo,toggleCollapse, logout }
})